import request from '@/router/axios';

//PPAP
//PPAP列表-不分页
export const getPPAPList = (params) => {
  return request({
    url: '/api/hg-public/ppaplist/list',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//PPAP列表分页
export const getPPAPPage = (current, size, params) => {
  return request({
    url: '/api/hg-public/ppaplist/page',
    method: 'get',
    params: {
      current,
      size,
      ...params,
    }
  })
} 

//根据产品图号和PPAP阶段（4，5）获取apqp
export const getProAPQPList = (params) => {
  return request({
    url: '/api/hg-public/apqplist/listbyphases',
    method: 'get',
    params: {
      ...params,
    }
  })
}

//新增PPAP
export const addPPAP = (row) => {
  return request({
    url: '/api/hg-public/ppaplist/save',
    method: 'post',
    data: row
  })
}

//删除PPAP
export const removePPAP = (productDrawingNos) => {
  return request({
    url: '/api/hg-public/ppaplist/remove',
    method: 'post',
    params: {
      productDrawingNos,
    }
  })
}

//更新PPAP
export const updatePPAP = (row) => {
  return request({
    url: '/api/hg-public/ppaplist/update',
    method: 'post',
    data: row
  })
}

//获取PPAP详情
export const getPPAP = (id) => {
  return request({
    url: '/api/hg-public/ppaplist/detail',
    method: 'get',
    params: {
      id,
    }
  })
}

